<!--
 * @Author: your name
 * @Date: 2021-06-07 20:26:12
 * @LastEditTime: 2021-06-08 08:33:39
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \jz-ui\src\pages\user\Role.vue
-->
<template>
  <div>
    <el-table :data="roles" size="small">
      <el-table-column prop="id" width="60" label="编号"></el-table-column>
      <el-table-column prop="name" label="角色名称"></el-table-column>
      <el-table-column label="编辑"  width="130" align="center">
        <template v-slot="scope">
          <el-button type="text" size="small" @click="editHandle(scope.row.id)">编辑</el-button>
          <el-button style="color:#909399" type="text" size="small" @click="authorizeHandle(scope.row.id)">授权</el-button>
        </template>
      </el-table-column>
    </el-table>
  </div>  
</template>

<script>
import {get} from '@/utils/request'
export default {
  
   data(){
    return {
      roles:[],
    }
  },
  methods:{ 
    loadData(){
      let url = "/baseRole/query"
      get(url).then(resp => {
        this.roles = resp.data
        console.log(resp.data)
      })
    },
    authorizeHandle(id){
      this.$message({message:"该功能暂未开发！",type:"error"});
    },
    editHandle(id){
      this.$message({message:"该功能暂未开发！",type:"error"});
    },
  },
  created(){
    this.loadData()
  }
}
</script>

<style lang="css">

</style>
